fix: remove body validation from unclean termination#398
fix: remove body validation from unclean termination#398rvagg merged 4 commits intorvagg/trustless-utilsfrom
Conversation
|
backburner for the immediate term, I just need to validate what's actually happening here because of a small amount of uncertainty because the internal body reader shouldn't encounter the problem while you're streaming data out until it reached the bad chunk, so it probably depends on |
12d0598 to
5beee8c
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## rvagg/trustless-utils #398 +/- ##
=========================================================
+ Coverage 76.28% 76.55% +0.27%
=========================================================
Files 85 85
Lines 6296 6296
=========================================================
+ Hits 4803 4820 +17
+ Misses 1244 1231 -13
+ Partials 249 245 -4 |
5beee8c to
54240ac
Compare
54240ac to
400e836
Compare
|
I think this is as good as it's going to get - instead of removing the body validation, this does more careful body slurping, inching up to the expected error so we get the full body and the error. Seems to be good, after many CI reruns. |
While doing #386 I discovered that Go's HTTP client, once it discovers an unclean end, will immediately decide that the body shouldn't be read. So you have up until the moment of it discovering the unclean end to read the body, after that point you get an EOF.
I wish I saved the Go src where I found this, it might be worth me going back and finding it to confirm that I'm talking sense here.
I believe this explains occasional flakies like this one: https://github.com/filecoin-project/lassie/actions/runs/5960306260/job/16167386428?pr=383
The answer is to just not bother attempting to validate bodies in our integration tests when it's an unclean end. I kind of wish it were different because we do want to validate this, but without the ability to control timing, or change this behaviour, I don't believe we can.